<?php

namespace App\Exports;

use Encore\Admin\Grid\Exporters\ExcelExporter;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping;

class SeaExport extends ExcelExporter implements WithMapping, WithHeadings, ShouldAutoSize
{

    //这里是导出来的文件的名字和格式
    protected $fileName = '公海列表.xlsx';
    //这里是excel的标题
    public function headings(): array
    {
        return [
            '流入时间',
            '姓名',
            '电话',
        ];
    }

    public function map($client): array
    {
        $data = [
            $client->go_sea_at,
            $client->name,
            $client->mobile,
        ];
        return $data;
    }



}
